#pragma once
#include "ease-out.hh"
#include <glm/vec3.hpp>
#include <glm/mat3x3.hpp>
#include <utility>		// for std::move

namespace gl
{
	struct camera
	{
		void xmove(float speed);
		void ymove(float speed);
		void zmove(float speed);
		void rotate(glm::vec3 const& offset);
		void dist(glm::vec3 d) { distance = std::move(d); }
		void update(float speed=0.2);
		auto& eye() const { return eye_; }
		auto eye_dist() const { return eye_dist_; }
		auto& pos() const { return position.get(); }
		auto& get() const { return m; }

		void reset()
		{
			rotation = glm::vec3{};
			position = glm::vec3{};
			distance = glm::vec3{0, 0, 1};
		}

	private:
		ease_out<glm::vec3> rotation{};
		ease_out<glm::vec3> position{};
		ease_out<glm::vec3> distance{{0, 0, 1}};
		glm::mat3 m;
		glm::vec3 eye_;
		float eye_dist_;
	};
}

